<!doctype html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
    <meta name="format-detection" content="telephone=no"/>
    <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
    <title>订单详情</title>
    <link href="<?php echo TEMPLATE_SITE_URL;?>/css/common.css" type="text/css" rel="stylesheet">
    <link href="<?php echo TEMPLATE_SITE_URL;?>/css/sale.css" type="text/css" rel="stylesheet">
    <link href="<?php echo TEMPLATE_SITE_URL;?>/css/sale-detail.css" type="text/css" rel="stylesheet">
    <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/zepto.js" charset="utf-8"></script>
    </head>
<body>
    <div id="contentbox">
    <div class="progressMain">

                    <div class="progressItem">
                        <div class="content">
                            <div class="title sale">
                                <div>拍品流拍</div>
                            </div>
                            <div class="detail">
                                <div class="time">流拍时间：<?php echo date("Y年m月d日 H:i",$output['auction']['end_time']);?></div>
                            </div>
                        </div>
                    </div>
    </div>

    <div class="orderMain">
    	<div class="orderItem">
            <div class="title" style="background-image: url(<?php echo $output['user']['avatar'];?>)">
                <div class="nickname">
                    <a href="index.php?act=my&op=home&uid=<?php echo $output['user']['user_id'];?>&user_id=<?php echo $output['auction']['seller_id']?>"><?php echo $output['user']['nickname'];?></a>
                </div>
                <div class="status">流拍</div>
            </div>

            <div class="info">
	                <a href="index.php?act=index&auction_id=<?php echo $output['auction']['id'];?>">
	            		<div class="content">
	                        <div class="goodsImg" style="background-image:url(<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$output['auction']['auction_add_date'].'/'.$output['auction']['auction_img1'];?>);"></div>
	                        <div class="desc"><?php echo bearshop_auction_description_substr($output['auction']['auction_description']);?></div>
	                        <ul>
	                        	<li><span>发布时间：</span><?php echo date("Y-m-d H:i:s",$output['auction']['add_time']);?></li>            
	            				<li><span>流拍时间：</span><?php echo date("Y-m-d H:i:s",$output['auction']['end_time']);?></li>
							</ul>
	                    </div> 
	                    
	                </a>
           </div>
                <div class="tools">
					<button class="xiajiapaipin" aid="<?php echo $output['auction']['id'];?>">下架</button>
			    	<button class="delauction" aid="<?php echo $output['auction']['id'];?>">删除拍品</button>
			    </div> 
           
        </div>

	    <div class="orderInfoMain">
	        <div class="title">订单信息</div>
	        <div class="saleUri">
	        	<span class="label">拍品编号：</span>
	        	<span class="value"><?php echo $output['auction']['auction_sn']?></span>
	        </div>
	    </div>
	    
    </div>
<script type="text/javascript">
$(function(){
	$('.xiajiapaipin').click(function(){
		if(confirm('确认下架？')){
			var auction_id = $(this).attr('aid');
			var state = '1';
			$.ajax({
				type:'get',
				url:'index.php?act=my&op=updatestate',
				data:{auction_id:auction_id,is_state:state},
				dataType:'json',
				success:function(data){
					if(data.state == 1){
						location.href="index.php?act=my&op=sellerorderliupai";
					}				
				}
			});
			return false;
		}	
	});	
	
	$('.delauction').click(function(){
		if(confirm('确认删除？')){
			var aid = $(this).attr('aid');
			$.ajax({
				type:'post',
				url:'index.php?act=my&op=sellerorderliupai',
				data:{aid:aid},
				dataType:'json',
				success:function(data){
					if(data.state){
						location.href='<?php echo BASE_SITE_URL?>/index.php?act=my';
					}
					return false;
				}
			});
		}
	});
});
</script>
<?php include template('home/nav');?>
</body>
</html>